﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace webservice_Project
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
    {
        public MainWindow()
        {
            InitializeComponent();
            informations();
        }

        private void button1_Click_1(object sender, RoutedEventArgs e)
        {
            grid1.Visibility = Visibility.Visible;
        }


           

        private void Button_Click(object sender, RoutedEventArgs e)
        {
            cmd.Console c = new cmd.Console();
            string sortie = c.Execute(textBox1.Text).Replace("----","\n").Replace(",","");
            textBox2.Text =  sortie.Substring(1,sortie.Length-2);

            //richTextBox1.AppendText (sortie.Substring(1, sortie.Length - 2));
        }

        private void informations()
        {
            info.InfoSysteme inf = new info.InfoSysteme();
            
            label4.Content = inf.getEspaceDisqueLibre().@return +" Mo libres sur "+inf.getEspaceDisqueTotal().@return+" Mo";
            label6.Content = inf.getHostName().@return;
            label8.Content = inf.getIpAdress().@return;
            label10.Content = inf.getJavaVersion().@return +" de "+ inf.getJavaVendor().@return;
            label12.Content = inf.getOsNom().@return + " v " + inf.getOsVersion().@return + ", Architecture : " + inf.getOsArch().@return;

            progressBar1.Maximum = inf.getEspaceDisqueTotal().@return;
            progressBar1.Minimum = 0;
            progressBar1.Value = inf.getEspaceDisqueTotal().@return - inf.getEspaceDisqueLibre().@return;
        }

        private void Window_Loaded(object sender, RoutedEventArgs e)
        {

        }

       

    }
}
